package com.ag.bean;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TbPlanStep entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TB_PLAN_STEP", schema = "dbo", catalog = "AGDB")
public class TbPlanStep implements java.io.Serializable {

	// Fields

	private String psId;
	private TbPlanStep tbPlanStep;
	private TbPlan tbPlan;
	private String psName;
	private String psContent;
	private String a;
	private String b;
	private String c;
	private Set<TbPlanStep> tbPlanSteps = new HashSet<TbPlanStep>(0);
	private Set<TbPsContent> tbPsContents = new HashSet<TbPsContent>(0);

	// Constructors

	/** default constructor */
	public TbPlanStep() {
	}

	/** minimal constructor */
	public TbPlanStep(String psId, String psName) {
		this.psId = psId;
		this.psName = psName;
	}

	/** full constructor */
	public TbPlanStep(String psId, TbPlanStep tbPlanStep, TbPlan tbPlan,
			String psName, String psContent, String a, String b, String c,
			Set<TbPlanStep> tbPlanSteps, Set<TbPsContent> tbPsContents) {
		this.psId = psId;
		this.tbPlanStep = tbPlanStep;
		this.tbPlan = tbPlan;
		this.psName = psName;
		this.psContent = psContent;
		this.a = a;
		this.b = b;
		this.c = c;
		this.tbPlanSteps = tbPlanSteps;
		this.tbPsContents = tbPsContents;
	}

	// Property accessors
	@Id
	@Column(name = "PS_ID", unique = true, nullable = false, length = 10)
	public String getPsId() {
		return this.psId;
	}

	public void setPsId(String psId) {
		this.psId = psId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TB__PS_ID")
	public TbPlanStep getTbPlanStep() {
		return this.tbPlanStep;
	}

	public void setTbPlanStep(TbPlanStep tbPlanStep) {
		this.tbPlanStep = tbPlanStep;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "P_ID")
	public TbPlan getTbPlan() {
		return this.tbPlan;
	}

	public void setTbPlan(TbPlan tbPlan) {
		this.tbPlan = tbPlan;
	}

	@Column(name = "PS_NAME", nullable = false, length = 200)
	public String getPsName() {
		return this.psName;
	}

	public void setPsName(String psName) {
		this.psName = psName;
	}

	@Column(name = "PS_CONTENT", length = 500)
	public String getPsContent() {
		return this.psContent;
	}

	public void setPsContent(String psContent) {
		this.psContent = psContent;
	}

	@Column(name = "A", length = 50)
	public String getA() {
		return this.a;
	}

	public void setA(String a) {
		this.a = a;
	}

	@Column(name = "B", length = 50)
	public String getB() {
		return this.b;
	}

	public void setB(String b) {
		this.b = b;
	}

	@Column(name = "C", length = 50)
	public String getC() {
		return this.c;
	}

	public void setC(String c) {
		this.c = c;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbPlanStep")
	public Set<TbPlanStep> getTbPlanSteps() {
		return this.tbPlanSteps;
	}

	public void setTbPlanSteps(Set<TbPlanStep> tbPlanSteps) {
		this.tbPlanSteps = tbPlanSteps;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbPlanStep")
	@javax.persistence.OrderBy("pscId")
	public Set<TbPsContent> getTbPsContents() {
		return this.tbPsContents;
	}

	public void setTbPsContents(Set<TbPsContent> tbPsContents) {
		this.tbPsContents = tbPsContents;
	}

}